package com.tl.boot.main.datasource;

import com.tl.boot.common.enums.LocalDataBaseEnum;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * com.tl.boot.main.datasource -- DynamicDataSource
 * Description:
 * Created by joshua_liu <a href="mailto:joshualwork@163.com"></a>
 * On 2019/9/24 17:16
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
    @Override
    protected Object determineCurrentLookupKey() {
        LocalDataBaseEnum dataBaseType = DataSourceType.getDataBaseType();
        return dataBaseType;
    }
}
